﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LCWMS.Common
{
    public class StorageLocation
    {
        public string FullCode { get; set; }      // 完整编码，如"02920111"
        public string ZoneCode { get; set; }      // 库区代码，如"0292"
        public string ShelfCode { get; set; }     // 货架代码，如"01"
        public int ShelfNumber { get; set; }      // 货架数字，如1
        public int Level { get; set; }            // 层数，如1-8
        public int Position { get; set; }         // 拣货位，如1-5

        public StorageLocation(string code)
        {
            FullCode = code;
            ZoneCode = code.Substring(0, 4);
            ShelfCode = code.Substring(4, 2);
            ShelfNumber = int.Parse(ShelfCode);
            Level = int.Parse(code.Substring(6, 1));
            Position = int.Parse(code.Substring(7, 1));
        }
    }
}
